package com.dreamweaver.mvvmtest.model;

import com.dreamweaver.mvvmtest.bean.User;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class UserModel extends ViewModel {
    private final MutableLiveData<User> userLiveData = new MutableLiveData<>();

    public MutableLiveData<User> getUserLiveData() {
        return userLiveData;
    }

    public UserModel() {
        userLiveData.postValue(new User(1, "小明"));
    }

    public void refreshData() {
        userLiveData.postValue(new User(2, "小红"));
    }

}
